<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="the_div">
        <p>我是p标签</p>
        <h3>我是h3</h3>
        <h3>我是h3</h3>
        <h3>我是h3</h3>
        <a id="theA" href="#">我是一个a标签</a>
        <ul>
            <li>北京</li>
            <li>天津</li>
            <li>南京</li>
        </ul>
        <ol class="my_li">
            <li>大张</li>
            <li>大王</li>
            <li>大狗</li>
        </ol>
        <ul class="my_li">
            <li>小明</li>
            <li>小红</li>
            <li>小蓝</li>
        </ul>
    </div>
    <script>
        // 第一问
        const a = document.querySelector('#theA')
        console.log(a)
        console.log(a.innerHTML)
        // /第二问
        const h3 = document.querySelectorAll('.the_div h3')
        console.log(h3)
        for (let i = 0; i < h3.length; i++) {
            console.log(h3[i])
        }
        // -第三问
        const li = document.querySelectorAll('.the_div li')
        console.log(li)
        for (let i = 0; i < li.length; i++) {
            console.log(li[i])
        }
        // *第四问
        const li2 = document.querySelectorAll('.the_div ul.my_li li')
        console.log(li2)
        for (let i = 0; i < li2.length; i++) {
            console.log(li2[i])
        }
        // +第五问
        const lired = document.querySelector('.the_div ul.my_li li:nth-child(2)')
        console.log(lired)
        lired.innerHTML = '小六'
        lired.style.color = 'red'
        // ?第六问
        const ul = document.querySelector('.the_div ul li:nth-child(2)')
        console.log(ul)
        ul.classList.add('bg')
        ul.style.backgroundColor = 'lawngreen'
        // todo
    </script>
</body>

</html>